@extends('../manage.layout')
@section('content')
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            系统管理
            <small>更改角色信息</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Level</a></li>
            <li class="active">Here</li>
        </ol>
    </section>
    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <!-- general form elements -->
                <div class="box-body table-responsive no-padding">
                    <div class="box box-primary">
                        {{--<div class="box-header with-border">--}}
                            {{--<h3 class="box-title">{{ $role['email'] }}</h3>--}}
                        {{--</div>--}}
                        <!-- /.box-header -->
                        <!-- form start -->
                        <form method="post" action="{{ url('manage/role/' . $role['id']) }}" enctype=”multipart/form-data”>
                            {{ method_field('PUT') }}
                            {{--{{ csrf_field() }}--}}
                            <input type="hidden" name="_token" value="{{ csrf_token() }}">

                            <div class="box-body">
                                <div class="form-group">
                                    <label for="exampleInputEmail1">角色名称</label>
                                    <input type="text" class="form-control" name="name" value="{{ $role['name'] }}" required="required">
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputEmail1">权重</label>
                                    <input type="number" min="0" class="form-control" id="exampleInputEmail1" name="rank" value="{{ $role['rank'] }}" required="required">
                                </div>

                            </div>
                            <!-- /.box-body -->

                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary">确定</button>&nbsp;&nbsp;<span class="btn btn-primary" onclick="window.location.href='/manage/role'">返回</span>
                            </div>
                         </form>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- /.content -->
@endsection
@section('script')
@endsection
<script src="/plugin/jquery/jquery-2.2.1.min.js"></script>
<script src="/plugin/layer-2.4/layer.js"></script>
{{--<script type="text/javascript">--}}
    {{--$(function () {--}}
        {{--$("form").submit(function(event) {--}}
            {{--event.preventDefault();--}}
            {{--var url = $(this).attr('action');--}}
            {{--ajaxToken({--}}
                {{--url: url,--}}
                {{--type: "POST",--}}
                {{--data: $("form").serialize(),--}}
                {{--dataType: "json",--}}
                {{--success: function(data) {--}}
                    {{--console.log(data);--}}
                    {{--layer.msg(data.msg);--}}
                {{--}--}}
            {{--});--}}
        {{--});--}}
    {{--});--}}
{{--</script>--}}